package com.zhangkeyou.map.mapweb.controller;

import com.zhangkeyou.map.mapweb.domain.entity.Location;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

@RestController
@RequestMapping("/api")
public class Controller {
    @GetMapping
    public String get(){
        int i = 1/0;
        return "index.html";
    }

    @PostMapping(value = "/location",produces = "application/json;charset=UTF-8")
    @ResponseBody
//    public String postLocation(@RequestParam Integer location){
    public String postLocation(@RequestBody Location location){
        System.out.println(new Date()+":"+location);
        return "index.html";
    }

}
